#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
size_t printarr(int* const p, const int sz) {
	int sum = 0;
	for (int i = 0; i < sz; i++) {
		printf("%d ", i[p]);
		sum += 1;
	}
	printf("\n");
	return sum;
}
int* reverse(int * const p, const int sz) {
	int* const ret = p;
	for (int i = 0; i < sz/2; i++) {
		int tmp = p[i];
		p[i] = p[sz-1 - i];
		p[sz - 1 - i] = tmp;
	}
	return ret;
}

int* init(int* const p,const int sz) {
	int* const ret = p;
	for (int i = 0; i < sz; i++) {
		*(p + i) = 0;
	}
	return ret;
}

int main() {
	int arr[20] = { 10,9,8,7,6,5,4,3,2,1,1,2,3,4,5,6,7,8,9,10 };
	int sz=sizeof(arr)/sizeof(arr[0]);
	for (int i = 0; i < sz-1; i++) {
		for (int j = 0; j < sz-1; j++)
			if (arr[j] > arr[j + 1]) {
				int tmp = arr[j];
				arr[j] = arr[j + 1];
				arr[j + 1] = tmp;
			}
	}
	printarr(arr, sz);
	reverse(arr, sz);
	printarr(arr, sz);
	init(arr, sz);
	printarr(arr, sz);

	return 0;
}